package test;

public class Test20210328question3 {
    public static void main(String[] args) {
        int a =14;
        int result = solution(a);
        System.out.println(result);
    }
    public static int solution(int a){
        int length=0;
        int t =a;
        //判断位数
        while(t!=0) {
            t = t / 10;
            length++;
        }
        int i = 0;
        while(a!=0){
            int temp =0;
            temp = a%2;
            a= a/2;
            if(temp==1) i++;
        }
        return i;
    }
}
